export default {
    namespaced: true,
    state: {
        form: {
            name: "",
            urls: "",
            level: "0", //菜单级别
            father: [], //选择父菜单
        },
        temporaryFatherData: [] //树状菜单列表
    },
    mutations: {
        clearForm(state) {
            state.form = {
                name: "",
                urls: "",
                level: "0", //菜单级别
                father: [], //选择父菜单
            }
        },
        udpateForm(state, data) {
            var tempLevel = '0';
            if(data.cc_fid != '0') {
                tempLevel = '1';
            }

            state.form = {
                name: data.cc_name,
                urls: data.cc_url,
                level: tempLevel, //菜单级别
            }
        },
        //更新菜单信息
        updateTemporaryFatherData(state, data) {
            state.temporaryFatherData = data
        },
    }
}